package com.ljf.utility.web;

import com.ljf.common.exception.ServiceException;
import com.ljf.common.result.ResultModel;
import com.ljf.common.web.NoDBBasisController;
import com.ljf.utility.dto.other.CalculateMath;
import com.ljf.utility.service.ICalculateService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * 计算器  控制器
 *
 * @author LJF
 * @since 2024-08-11
 */
@RestController
@RequestMapping("/utility/calculate")
@Api(value = "计算器接口", tags = "计算器接口")
public class CalculateController extends NoDBBasisController<ICalculateService> {

    @PostMapping("/math_calculator")
    @ApiOperation(value = "数学计算器接口")
    public ResultModel mathCalculator(@RequestBody CalculateMath model) throws ServiceException {
        return service.mathCalculator(model);
    }

}
